#ifndef LIE_IMAGE_MANAGER_H
#define LIE_IMAGE_MANAGER_H

/*
    Singleton version of the imageManager from
    "http://www.sfml-dev.org/wiki/fr/sources/imagemanager" by Adrian Gaudebert
*/
#include <map>
#include <SFML/Graphics.hpp>

class ImageManager
{
private:
    std::map<std::string, sf::Texture*> Images;

    bool SearchImage(const std::string &ImageLink, sf::Texture* &ImgTemp);
    sf::Texture *CreateImage(const std::string &ImageLink);

    ImageManager(const ImageManager&);
    ImageManager& operator= (const ImageManager&);
    ImageManager();
    ~ImageManager();
    static ImageManager singleton;

public:

    sf::Texture *GetImage(const std::string &ImageLink);

    void DeleteImage(sf::Texture &Img);
    void DeleteImage(const std::string& ImageLink);

    static ImageManager getSingleton(){return singleton;};
    static ImageManager* getSingletonPtr(){return &singleton;};
};

#endif
